package com.bjpowernode.crm.settings.service.impl;

import com.bjpowernode.crm.settings.domain.DicType;
import com.bjpowernode.crm.settings.mapper.DicTypeMapper;
import com.bjpowernode.crm.settings.service.DicTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * ClassName: DicTypeServiceImpl<br/>
 * Package: com.bjpowernode.crm.settings.service.impl<br/>
 * Description: <br/>
 * Date: 2022/7/2 22:00<br/>
 * Auther:对的我写的，错的我同事写的<br/>
 */
@Service
public class DicTypeServiceImpl implements DicTypeService {

    @Resource
    private DicTypeMapper dicTypeMapper;
    @Override
    public List<DicType> queryAllDictypes() {
        return (List<DicType>) dicTypeMapper.queryAllDictypes();
    }

    @Override
    public DicType queryCode(String code) {
        return dicTypeMapper.selectByPrimaryKey(code);
    }

    @Override
    public Integer saveCreateDicType(DicType dicType) {
        return dicTypeMapper.insertSelective(dicType);
    }

    @Override
    public Integer updateDictype(DicType dicType) {
        return dicTypeMapper.updateByPrimaryKeySelective(dicType);
    }

    @Override
    public Integer deleteDictypebyCodes(String[] codes) {
        return dicTypeMapper.deleteDictypebyCodes(codes);
    }
}
